{% from "front/_macros.html" import load_static_file %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>{% block title %}{% endblock %}</title>
    <!-- jQuery -->
    <script src="{{ load_static_file("front/js/jquery-3.1.1.min.js") }}"></script>

    <!-- Bootstrap CSS -->

    <link href="{{ load_static_file("front/css/bootstrap-3.3.7.min.css") }}" rel="stylesheet">

    <!-- Bootstrap JS -->
    <script src="{{ load_static_file("front/js/bootstrap-3.3.7.min.js") }}"></script>

    <!-- SocketIO js -->
    <script src="https://cdn.socket.io/4.7.5/socket.io.min.js"></script>

    <!-- 前端集成SocketIO -->
    <script src="{{ load_static_file("front/js/disabled_user.js") }}"></script>
    <link rel="stylesheet" href="{{ load_static_file("front/css/front_base.css") }}">
    <link rel="stylesheet" href="{{ load_static_file("sweetalert/sweetalert.css") }}">
    <script src="{{ load_static_file("front/js/csrf_ajax.js") }}"></script>
    <script src="{{ load_static_file("front/js/query_post.js") }}"></script>
    <script src="{{ load_static_file("sweetalert/sweetalert.min.js") }}"></script>
    <script src="{{ load_static_file("sweetalert/xtalert.js") }}"></script>
    {% block head %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">汇智论坛</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active"><a href="/">首页 <span class="sr-only">(current)</span></a></li>
            </ul>
            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" id="post-kw" placeholder="请输入关键字">
                </div>
                <button type="submit" class="btn btn-default" id="query">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                {% if g.user %}
                    <span id="login-tag" data-is-login="1" style="display:none;"></span>
                    <li class="dropdown" data-user-id="{{ g.user.id }}" id="user-info">
                        <a href="#" class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"
                           aria-haspopup="true" aria-expanded="true">
                            {{ g.user.username }}
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                            {% if g.user.is_staff %}
                                <li><a href="{{ url_for("front.cms_view") }}" target="_blank">后台管理</a></li>
                            {% endif %}
                            <li><a href="{{ url_for("front.person_info") }}" target="_blank">个人中心</a></li>
                            <li><a href="{{ url_for("front.logout") }}">注销</a></li>
                        </ul>
                    </li>
                {% else %}
                    <li><a href="{{ url_for('front.login') }}">登录</a></li>
                    <li><a href="{{ url_for("front.register") }}">注册</a></li>
                {% endif %}

            </ul>
        </div>
    </div>
</nav>
<div class="main-container">
    {% block body %}{% endblock %}
</div>


</body>
</html>
